package de.beuth.hochschule.ats.entitys;

import java.io.Serializable;

import com.j256.ormlite.field.DatabaseField;

public class Vocable implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@DatabaseField(generatedId = true, canBeNull=false)
	int id;
	@DatabaseField(canBeNull=false)
	int level;
	@DatabaseField(canBeNull=false)
	String question;
	@DatabaseField(canBeNull=false)
	String answer;
	@DatabaseField(canBeNull=false, foreign=true)
	Lecture lecture;

	public int getId() {return id;}
	public String getQuestion() {return question;}
	public String getAnswer() {return answer;}	
	public Lecture getLecture() {return lecture;}

	public Vocable() {
		level = 0;
	}
	
	public void update(String question, String answer, Lecture lecture) {
		this.question = question;
		this.answer = answer;
		this.lecture = lecture;
	}
	
	public String toString() {
		return question + " - " + answer;
	}
}
